{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Load Magic Command"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "%classpath add jar ../../../doc/resources/jar/loadMagicJarDemo.jar"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "%load_magic com.twosigma.beakerx.custom.magic.command.ShowEnvsCustomMagicCommand"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "%showEnvs"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Show Null Execution Result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "com.twosigma.beakerx.kernel.Kernel.showNullExecutionResult"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "com.twosigma.beakerx.kernel.Kernel.showNullExecutionResult = true;\n",
    "String seeNullString = null;\n",
    "seeNullString"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "com.twosigma.beakerx.kernel.Kernel.showNullExecutionResult = false;\n",
    "String noNullString = null;\n",
    "noNullString"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# JVM Repr"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import jupyter.Displayer;\n",
    "import jupyter.Displayers;\n",
    "Displayers.register(Integer.class, new Displayer<Integer>() {\n",
    "  @Override\n",
    "  public Map<String, String> display(Integer value) {\n",
    "    return new HashMap<String, String>() {{\n",
    "      put(MIMEContainer.MIME.TEXT_HTML, \"<div><h1>\" + value + \"</h1></div>\");\n",
    "\n",
    "    }};\n",
    "  }\n",
    "});"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "1+1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Groovy",
   "language": "groovy",
   "name": "groovy"
  },
  "language_info": {
   "codemirror_mode": "groovy",
   "file_extension": ".groovy",
   "mimetype": "",
   "name": "Groovy",
   "nbconverter_exporter": "",
   "version": "2.4.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
